<style>
.labelspan {
	font-weight: bold;
	display: block;
	margin: 4px 10px;
	font-size: larger;
}

input.ui-input-text,textarea.ui-input-text {
	width: 90%;
}
</style>
<script type="text/javascript">
function checkPost(){
	if($("#postContent").val().length <10){
		alert("评论字数必须大于10个字符");
		return false;
	}
}

</script>
<script type="text/javascript">
$(function(){
      $('#wysiwyg').wysiwyg();
});
</script>
<link rel="stylesheet"
	href="<?php echo Yii::app()->request->baseUrl;?>/jwysiwyg/jquery.wysiwyg.css"
	type="text/css" />
<script
	type="text/javascript"
	src="<?php echo Yii::app()->request->baseUrl;?>/jwysiwyg/jquery.wysiwyg.js"></script>
<!-- Start of first page -->
<div data-role="page" id='editPage'>
	<div data-role="header" data-theme="b">
		<?php echo CHtml::link("返回",array("bbs/list", "id"=>$bbs->id), array("data-icon"=>"back"));?>
		<h1><?php echo $bbs->title;?>-新帖</h1>
	</div>
	<!-- /content -->

	<?php echo CHtml::form('','post',array("onsubmit"=>"return checkPost();",'enctype'=>'multipart/form-data',"data-ajax"=>"false","id"=>"postForm")); ?>
		<input type="hidden" name="$id"
			value="<?php echo $bbs->id;?>" />
		<table style='width: 100%'>
			<?php if(!empty($error)):?>
			<tr>
				<td></td><td><font color='red'>Error: <?php echo $error?></font></td>
			</tr>
			<?php endif?>
			<tr>
				<td width="70px"><span class='labelspan'>标题<span style='color: #c00'>*</span>
				</span>
				</td>
				<td>
				<div data-role="fieldcontain"><?php echo CHtml::activeTextField($post,"title");?></div>
				</td>
			</tr>
			<tr>
				<td><span class='labelspan'>内容<span style='color: #c00'>*</span> </span>
				</td>
				<?php if(Utils::checkMobile()==0):?>
				<td><div data-role="fieldcontain"><?php echo CHtml::activeTextArea($post,"content",array("id"=>"wysiwyg", 'style'=>'height: 230px; width: 90%')); ?></div></td>
				<?php else:?>
				<td><div data-role="fieldcontain"><?php echo CHtml::activeTextArea($post,"content",array("id"=>"postContent",'style'=>'height: 230px; width: 90%')); ?></div></td>
				<?php endif?>
			</tr>
			<tr>
				<td colspan='2'>
				<div data-role="fieldcontain" style="margin-left: 20px;">		
					<input type='file'class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"name="image[]"> <br />
					<?php if(!yii::app()->user->isGuest  && UserIdentity::getFlag(Yii::app()->user->id) =="admin"):?>
					<input type='file'class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"name="image[]"> <br />
					<input type='file'class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"name="image[]"> <br />
					<input type='file'class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"name="image[]"> <br />
					<input type='file'class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"name="image[]"> <br />
					<?php endif?>
				</div>
				</td>
			</tr>
			<tr>
				<td><span class='labelspan'></span></td>
				<td>
					<div data-role="controlgroup" data-type="horizontal">
						<a data-role="button" data-icon="grid" data-inline="true" rel='external' href="<?php echo Yii::app()->createUrl('gallery/index#viewAll'); ?>">图片库</a>
						<input type='submit' data-icon="check" value='确定' />
					</div>
				</td>
			</tr>
		</table>
	<?php echo CHtml::endForm(); ?>
	
	<?php $this->renderPartial("//site/footer")?>
	<!-- /footer -->
	
</div>
<!-- /page -->
